import { createSlice } from '@reduxjs/toolkit'

export const Citystore = createSlice({
  name: 'Citystore',
  initialState: {
   start:'北京',
   end:'三亚'
  },
  reducers: {
   Cityslice(state,{payload}){
    state[payload.type]=payload.city
   },
   ExChange(state){
    let temp=state.start
    state.start=state.end
    state.end=temp
   }
  }
})
// 每个 case reducer 函数会生成对应的 Action creators
export const { Cityslice,ExChange } = Citystore.actions

export default Citystore.reducer